<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<s:if test="type==1">
	<title>个人贷款调查</title>
	<span id="navlink">贷款审批 >> 个人贷款调查<s:if test="isCanChange!=0">信息录入</s:if></span>
</s:if>
<s:elseif test="type==2">
	<title>企业贷款调查</title>
	<span id="navlink">贷款审批 >> 企业贷款调查<s:if test="isCanChange!=0">信息录入</s:if></span>
</s:elseif>

<script type="text/javascript"
	src="<%=request.getContextPath()%>/js/creditCheck/creditSurvey.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/js/creditCheck/creditInformation.js"></script>

<form id="form" action="creditSurveyAction" enctype="multipart/form-data" method="post">
	<s:hidden name="type" value="%{#request.type}" />
	<s:hidden name="appid" value="%{creditCheckBean.applyid}"/>
	<s:hidden name="applyType" value="%{creditCheckBean.applyType}"/>
	<s:hidden name="isCan" value="%{isCanChange}"/>
	<s:div id="left_area" cssClass="readonly">
		<s:if test="type==1">
			<th>申请单号:<span>RFG</span>
					<s:text name="%{creditCheckBean.applyid}" /></th>
		</s:if>
		<s:elseif test="type==2">
			<th>申请单号:<span>RFQ</span>
					<s:text name="%{creditCheckBean.applyid}" /></th>
		</s:elseif>

	</s:div>
	<s:div id="top_area" cssClass="readonly">
		<th>申请日期:<s:text name="f.date.ymd">
				<s:param value="%{creditCheckBean.applyDate}" />
			</s:text></th>
	</s:div>
	<s:div id="record">
		<br>
		<table class="table_box table_all_border">
			<tr>
				<th>操作类型</th>
				<th>结果</th>
				<th>意见</th>
				<th>操作人员</th>
				<th>调查报告</th>
				<th>操作日期</th>
			</tr>
			<s:iterator value="recordList" status="index" var="var">
				<tr>
					<td>${checktype }</td>
					<td>${result }</td>
					<td>${opinion }</td>
					<td>${managerid }</td>
					<s:if test="result==null&&checktype=='调查'">
						<td><a href="${docpath }" target="_blank">点击查看文件</a></td>
					</s:if><s:else>
						<td></td>
					</s:else>
					<td><s:text name="f.date.ymd">
							<s:param value="%{dodate}" />
						</s:text></td>
				</tr>
			</s:iterator>
		</table>
	</s:div>
	<br>
	<hr>
	<br>
	<s:if test="isCanChange!=0">
		<table class="table_box table_all_border">
			<tr>
				<th><span class="need">*</span> 调查意见</th>
				<td><s:textarea name="advice" id="advice" value="" cols="50"
						rows="5" />
				</td>
			</tr>
			<tr>
				<th><span class="need">*</span> 上传调查意见</th>
				<td><input type="file" name="pic200" id="file" value="选择文件" /></td>
			</tr>
		</table>
	</s:if>
	<br>
<%-- <s:if test="isCanChange==1||isCanChange==2">
<s:div id="left_area">
		<input type="button" value="填写利率，修改金额，期限" id="editthis" />
	</s:div>
</s:if> --%>
<s:if test="isCanChange==1||isCanChange==2">
<s:div id="right_area">
		<a href="creditSurveyAction!getOneEdit?type=${type }&appid=${creditCheckBean.applyid}">修改申请信息</a>
	</s:div>
</s:if>
	<table class="table_box table_all_border">
	<s:if test="isCanChange==1">
		<tr>
		<th><b>客户名称</b></th>
		<s:if test="type==1">
			<td><a target="_blank" href="../custom/personalAction!personalShow?id=${creditCheckBean.clientid}&PFLAG=BASIC"><s:text name="%{creditCheckBean.customName}" /></a></td>
		</s:if>
		<s:elseif test="type==2">
			<td><a target="_blank" href="../custom/customShow!companyshow?id=${creditCheckBean.clientid}"> <s:text
						name="%{creditCheckBean.customName}" /> </a>
			</td>
		</s:elseif>
	</tr>
	</s:if><s:else>
	<tr>
		<th><b>客户名称</b></th>
		<s:if test="type==1">
			<td><a target="_blank" href="../custom/personalAction!personalModify?id=${creditCheckBean.clientid}&PFLAG=BASIC"><s:text name="%{creditCheckBean.customName}" />
			</a>
			</td>
		</s:if>
		<s:elseif test="type==2">
			<td><a target="_blank" href="../custom/customShow!companymodify?id=${creditCheckBean.clientid}"> <s:text
						name="%{creditCheckBean.customName}" /> </a>
			</td>
		</s:elseif>
	</tr>
	</s:else>
	<tr>
			<th><b>申请金额</b></th>
			<td><s:textfield value="%{creditCheckBean.applyMoney}" name="loanaccount" cssClass="readonly"
					readonly="true"/> </td>
		</tr>
		<tr>
			<th>贷款期限</th>
			<th align="left"><s:textfield name="applytime"
					value="%{creditCheckBean.applyTime}" cssClass="readonly"
					readonly="true" size="5" />&nbsp;&nbsp; <s:select name="applytimetype" list="#{'年':'年','月':'月','天':'天' }" cssClass="readonly" disabled="true" value="%{creditCheckBean.applyTimeType}"/>
			</th>
		</tr>
		<tr>
		<th>贷款类型</th>
		<s:if test="type==1">
			<th><a target="_blank" href="javascript:void(0);"
				id="personalTypeHref"><s:text
						name="%{creditCheckBean.applyTypeStr}" /> </a>
			</th>
		</s:if>
		<s:elseif test="type==2">
			<th><a target="_blank" href="javascript:void(0);"
				id="enterpriseTypeHref"><s:text
						name="%{creditCheckBean.applyTypeStr}" /> </a>
			</th>
		</s:elseif>
	</tr>
		<s:if test="isCanChange==1">
			<tr>
				<th>基准利率</th>
				<td><s:textfield name="applybaserate" id="applybaserate"
						value="%{appRate.applybaserate}" cssClass="readonly"
						readonly="true" />%</td>
			</tr>
		</s:if>
		<s:else>
			<tr>
				<th>基准利率</th>
				<td><s:textfield name="applybaserate" id="applybaserate"
						value="%{creditCheckBean.applybaserate}" cssClass="readonly"
						readonly="true" />%</td>
			</tr>
		</s:else>
		<s:if test="isCanChange==1||isCanChange==2">
			<tr>
				<th>浮动比例</th>
				<td><s:textfield name="slidingscale" id="slidingscale"
						value="0"/>% <s:select
						name="upOrDown" id="upOrDown" list="#{'1':'上浮','2':'下调'}"/></td>
			</tr>
			<tr>
				<th>执行利率</th>
				<td><s:textfield name="performrates" id="performrates"
						value="%{creditCheckBean.performrates}"/>%</td>
			</tr>
			</s:if><s:else>
			<tr>
				<th>浮动比例</th>
				<td><s:textfield name="slidingscale" id="slidingscale"
						value="0" cssClass="readonly"
						readonly="true"/>% <s:select
						name="upOrDown" id="upOrDown" list="#{'1':'上浮','2':'下调'}" cssClass="readonly"/></td>
			</tr>
			<tr>
				<th>执行利率</th>
				<td><s:textfield name="performrates" id="performrates"
						value="%{creditCheckBean.performrates}" cssClass="readonly" readonly="true"/>%</td>
			</tr>
			</s:else>
	</table>
	<s:div id="button_area">
		<s:submit value="提交" method="doSurvey" />
		<input type="button" value="取消" onclick="javascript:history.go(-1);" />
	</s:div>
</form>
<script type="text/javascript">
<!--
	$(document).ready(function(){
		var isCan = $("#isCan").val();
		if (isCan == 1) {

		} else if(isCan == 0){
			var num = ${creditCheckBean.slidingscale};
			calcDifferent(num, "#slidingscale");
		}else if(isCan == 2){
			var num = ${creditCheckBean.slidingscale};
			var str = Math.abs(num-100);
			if(num >= 100){
				$("#upOrDown").val(1);
				$("#slidingscale").val(str);
			}else if(num < 100){
				$("#upOrDown").val(2);
				$("#slidingscale").val(str);
			}
		}
	});
	
//-->
</script>
<script type="text/javascript">
<!--
		$("#editthis").click(function(){
			$(".readonly").removeAttr("disabled");
			$(".readonly").removeAttr("readonly");
		});
		
		$("#editinfor").click(function(){
			alert("跳转");
			//$(".readonly").removeAttr("readonly");
		});
		
//-->
</script>
